<!--
Needs a mainLayer div to work.
Needs to have the name of servlet of the client : clientName.
Needs to have the name of the div to be modified after validating the popup : modifDiv
-->

<script type="text/javascript" src="javascript/prototype.js"></script>
<script type="text/javascript" src="javascript/rico.js"></script>
<script language="JavaScript">
<!--
	function openStructurePopup() {
		document.getElementById('structurePopup').style.visibility = "visible";
		document.getElementById('mainLayer').style.visibility = "hidden";
	}
	
	function closeStructurePopup() {
		// Send the structure ids to the manager
		ajaxEngine.registerRequest('sendId','<%=clientName%>');
		ajaxEngine.registerAjaxElement('<%=modifDiv%>');
		ajaxEngine.registerAjaxElement('<%=modifDiv2%>');
		var var1 = new Date() ;
		var var2 = var1.getTime() ;
		ajaxEngine.sendRequest('sendId', "method=structuresSelected","myTime="+var2,
			"structuresIds="+getSelectedNodes());
	
		document.getElementById('structurePopup').style.visibility = "hidden";
		document.getElementById('mainLayer').style.visibility = "visible";
	}
	
	// Recup des noeuds selectionnes -> ceux qui ont pour classe select
	function getSelectedNodes() {
		var str="";
		var list = document.getElementsByTagName("SPAN");
		for(var i=0; i<list.length; i++){
			var elSpan = list[i];
			if(elSpan.className=="select")
				str += elSpan.id;
		}
		return str;
	}
-->
</script>

<div id="structurePopup" class="modalPopup">
	<%@include file="selectMultiStructure.jsp"%>
	<a href="javascript:closeStructurePopup();">
		<bean:message key="action.close"/>
	</a>
</div>